package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Hanlan;
import com.example.demo.mapper.HanlanMapper;
import com.example.demo.service.HanlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (Hanlan)表服务实现类
 *
 * @author makejava
 * @since 2023-11-19 18:48:09
 */
@Service("hanlanService")
public class HanlanServiceImpl extends ServiceImpl<HanlanMapper, Hanlan> implements HanlanService {

    @Autowired
    private HanlanMapper HanlanMapper;

    public List<Hanlan> selectAll() {
        return HanlanMapper.selectList(null);
    }

    public List<Hanlan> getByCategory(Long category) {
        QueryWrapper<Hanlan> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("category", category);
        return HanlanMapper.selectList(queryWrapper);
    }
}
